package com.boss;

import com.boss.annotation.EnableDiscoveryClientBridge;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
//import org.springframework.boot.context.embedded.EmbeddedServletContainerFactory;
//import org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainerFactory;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;

import java.util.concurrent.Executor;

@SpringBootApplication
@EnableAspectJAutoProxy(exposeProxy = true)
//@SpringBootApplication(scanBasePackages = {"com.boss"}, exclude = {FreeMarkerAutoConfiguration.class})
@ServletComponentScan(basePackages = {"com.boss.filter"})
//@EnableTransactionManagement
@EnableDiscoveryClientBridge
@EnableAsync
public class SalaryApplication {

    public static void main(String[] args) {
        SpringApplication.run(SalaryApplication.class);
        System.out.println("工资信息服务启动成功");
    }

//    @Bean
//    public EmbeddedServletContainerFactory servletContainer() {
//        return new TomcatEmbeddedServletContainerFactory();
//    }
    @Bean(name = "threadPoolTaskExecutor")
    public Executor threadPoolTaskExecutor() {
        return new ThreadPoolTaskExecutor();
    }

}
